package services;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: shameera
 * Date: 1/22/12
 * Time: 8:57 PM
 * To change this template use File | Settings | File Templates.
 */
public class StudentService {

    //    services.Student[] students = new services.Student[5];
    List<Student> students = new ArrayList<Student>();
    
    
    public void addStudent(Student student) {
//        System.out.println("im triggered");
        students.add(student);
    }

    public Student getStudentByName(String name) {
//        for (Student stu : students) {
//            if(stu.name == name){
//                return stu;
//            }
//        }
        Student stu = new Student(name, 23);
        return stu;
//        return null;
    }
    
    public int getStudentAgeByName(String  name) {
        for (Student stu : students) {
            if(stu.name == name){
                return 0;//stu.age;
            }
        }
        return 0;
    }

    public String testMultipleParam(Student stu, String str) {
        return "hurayyyyy";
    }
    
    public String testNoParameter() {
        return "succeeded";
    }
    

}
